package com.aaa.backsystem.dao;

import com.aaa.backsystem.entity.Dept;
import com.aaa.backsystem.entity.PetrolStation;
import com.aaa.backsystem.entity.PetrolStationVo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author gyc
 * @since 2020-07-23
 */
@Mapper
@Repository
public interface PetrolStationDao extends BaseMapper<PetrolStation> {
    /**
     * 根据id查询油站信息
     **/
    List<PetrolStation> selectByPetrolStationId(Integer petrolStationId);

    /**
     * 根据部门id查询部门名称
     **/
    List<Dept> selectDept(Integer deptId);


    /**
     * 分页，多条件查询
     * @param pageInfo
     * @param condition
     * @return
     */
    List<PetrolStationVo> findAllPetrolStationAndDeptName(@Param("pageInfo") Page<PetrolStationVo> pageInfo, @Param("condition") Map<String, Object> condition);
}
